package auth

import (
	"kubem/controllers/auth"
	"kubem/middleware"

	"github.com/gin-gonic/gin"
)

func Login(g *gin.RouterGroup) {
	g.POST("/login", auth.Login)
}

func logout(g *gin.RouterGroup) {
	g.GET("/logout", auth.Logout)
}

func RegistrySubRoutes(g *gin.RouterGroup) {
	authGroup := g.Group("/auth")
	Login(authGroup)
	authGroup.Use(middleware.JWTAuthMiddleware())
	logout(authGroup)
}
